// pages/login/login.js
Page({
  data: {
    userInfo: {},
    openid: ''
  },
  handleGetUserInfo(e) {
    const that = this
    wx.cloud.callFunction({
      name: 'login',
      success: res => {
        that.setData({
          openid: res.result.openid,
          userInfo: e.detail.userInfo
        })
        that.data.userInfo.openid = that.data.openid
        wx.setStorageSync('userInfo', that.data.userInfo)
        // 跳转
        wx.navigateBack({
          delta: 1
        })
      }
    })

  }
})